<!DOCTYPE html>
<html lang="en" xmlns="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" integrity="sha512-Evv84Mr4kqVGRNSgIGL/F/aIDqQb7xQ2vcrdIwxfjThSH8CSR7PBEakCr51Ck+w+/U6swU2Im1vVX0SVk9ABhg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
    <link rel="stylesheet" href="../css/mystore.css">
    <title>Mypetstore</title>
    <script src="https://code.jquery.com/jquery-3.6.1.min.js"></script>
</head>
<body>
<div th:replace="~{common/top}"></div>

<div id="BackLink">
    <a th:href="'/catalog/viewCategory?categoryId='+${product.categoryId}" class="btn">
        <i class="fa-solid fa-chevron-left"></i>
        Return to <label th:text="${product.categoryId}">Category ID</label>
    </a>
</div>

<div id="Catalog" class="Catalog">

    <h2 th:text="${product.productName}">Product Name</h2>

    <table>
        <tr>
            <th>Item ID</th>
            <th>Product ID</th>
            <th>Description</th>
            <th>List Price</th>
            <th>&nbsp;</th>
        </tr>
        <tr th:each="item:${product.itemList}">
            <td><a th:href="'/catalog/viewItem?itemId='+${item.itemId}" th:text="${item.itemId}" >Item ID</a></td>
            <td th:text="${product.productId}">Product ID</td>
            <td th:text="${item.attribute1}">
                Item Attributes
            </td>
            <!--                    <td th:text="${item.listPrice}">Item List Price</td>-->
            <td th:text="'$'+${#numbers.formatDecimal(item.listPrice,1,2)}">Item List Price</td>
            <td><a th:href="'/cart?itemId='+${item.itemId}" class="btn">Add to Cart</a></td>
        </tr>
    </table>

</div>
<footer th:replace="~{common/bottom}"></footer>
</body>

</html>